package src.com.foreknow.demo6;

/**
 * 方法的参数和返回值类型为自定义类类型在实际项目中的使用
 */

public class ManagerApplication {

    //添加员工 insert into employee values (?,?,?,?)
    public void addEmployee(Employee employee){
        System.out.println(employee.getCard());
        System.out.println(employee.getDept());
        System.out.println(employee.getDept());
        System.out.println(employee.getName());
    }

    //登录 select * from employee where username=? and password=?
    public Employee getQuery(String username,String password){
        Employee e = new Employee();
        e.setCard(1002);
        e.setDept("program");
        e.setName("jazz");
        e.setSalary(4567.5);
        return e;
    }


    public static void main(String[] args) {
        ManagerApplication application = new ManagerApplication();
        Employee emp = new Employee();
        //可以通过set方法给对象的属性设置值
        emp.setCard(1000);
        emp.setSalary(4567.5);
        emp.setName("tom");
        emp.setDept("市场部");
        application.addEmployee(emp);

        Employee e = application.getQuery("gibson","123456");
        System.out.println(e.getName());
    }
}






